package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SubscribeDateMapper;
import com.ruoyi.system.domain.SubscribeDate;
import com.ruoyi.system.service.ISubscribeDateService;

/**
 * 可预约时间设置Service业务层处理
 *
 * @author ruoyi
 * @date 2023-08-14
 */
@Service
public class SubscribeDateServiceImpl implements ISubscribeDateService
{
    @Autowired
    private SubscribeDateMapper subscribeDateMapper;

    @Override
    public List<SubscribeDate> getSubscribeDateList() {
        return subscribeDateMapper.getSubscribeDateList();
    }

    /**
     * 查询可预约时间设置
     *
     * @param id 可预约时间设置主键
     * @return 可预约时间设置
     */
    @Override
    public SubscribeDate selectSubscribeDateById(Long id)
    {
        return subscribeDateMapper.selectSubscribeDateById(id);
    }

    /**
     * 查询可预约时间设置列表
     *
     * @param subscribeDate 可预约时间设置
     * @return 可预约时间设置
     */
    @Override
    public List<SubscribeDate> selectSubscribeDateList(SubscribeDate subscribeDate)
    {
        return subscribeDateMapper.selectSubscribeDateList(subscribeDate);
    }

    /**
     * 新增可预约时间设置
     *
     * @param subscribeDate 可预约时间设置
     * @return 结果
     */
    @Override
    public int insertSubscribeDate(SubscribeDate subscribeDate)
    {
        subscribeDate.setCreateTime(DateUtils.getNowDate());
        return subscribeDateMapper.insertSubscribeDate(subscribeDate);
    }

    /**
     * 修改可预约时间设置
     *
     * @param subscribeDate 可预约时间设置
     * @return 结果
     */
    @Override
    public int updateSubscribeDate(SubscribeDate subscribeDate)
    {
        subscribeDate.setUpdateTime(DateUtils.getNowDate());
        return subscribeDateMapper.updateSubscribeDate(subscribeDate);
    }

    /**
     * 删除可预约时间设置
     *
     * @return 结果
     */
    @Override
    public int deleteSubscribeDate(Integer year, Integer month, Integer day)
    {
        return subscribeDateMapper.deleteSubscribeDate(year, month, day);
    }

    /**
     * 删除可预约时间设置信息
     *
     * @param id 可预约时间设置主键
     * @return 结果
     */
    @Override
    public int deleteSubscribeDateById(Long id)
    {
        return subscribeDateMapper.deleteSubscribeDateById(id);
    }

    @Override
    public SubscribeDate getSubscribeDate(Integer year, Integer month, Integer day) {
        return subscribeDateMapper.getSubscribeDate(year,month,day);
    }
}
